﻿using System;
using System.Threading;
using System.Windows.Forms;
using pub.NET20Fix;

namespace todo
{
    internal static class Program
    {
        /// <summary>
        ///   The main entry point for the application.
        /// </summary>
        [STAThread]
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //
            App.Initialize();

            //
            if (Test())
            {
                return;
            }

            //
            App.MainForm = new FrmMain();
            App.MainForm.InitUI();
            
            //Dispatcher.Current = new Dispatcher(App.MainForm);
            Dispatcher.Current = new SynchronizationDispatcher(SynchronizationContext.Current);
//            Dispatcher.Current = new LastFormDispatcher();

            Application.Run(App.MainForm);
        }

        private static bool Test()
        {
            var noTest = false;
            noTest = true;
            if (noTest)
            {
                return false;
            }

            var startTick = Environment.TickCount;

            return true;
        }
    }
}